package com.exrobot.module.rbt.dal.mysql.robotbox;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.robotbox.RobotBoxDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.robotbox.vo.*;

/**
 * 餐车和盒配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RobotBoxMapper extends BaseMapperX<RobotBoxDO> {

    default PageResult<RobotBoxDO> selectPage(RobotBoxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotBoxDO>()
                .eqIfPresent(RobotBoxDO::getRobotSn, reqVO.getRobotSn())
                .inIfPresent(RobotBoxDO::getRobotSn, reqVO.getRobotSns())
                .eqIfPresent(RobotBoxDO::getBoxNo, reqVO.getBoxNo())
                .eqIfPresent(RobotBoxDO::getFoodSize, reqVO.getFoodSize())
                .eqIfPresent(RobotBoxDO::getSort, reqVO.getSort())
                .orderByDesc(RobotBoxDO::getId));
    }

}